\(\int x^3 (a+b \text {sech}(c+d x^2)) \, dx\) [3]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 16, antiderivative size = 77 \[ \int x^3 \left (a+b \text {sech}\left (c+d x^2\right )\right ) \, dx=\frac {a x^4}{4}+\frac {b x^2 \arctan \left (e^{c+d x^2}\right )}{d}-\frac {i b \operatorname {PolyLog}\left (2,-i e^{c+d x^2}\right )}{2 d^2}+\frac {i b \operatorname {PolyLog}\left (2,i e^{c+d x^2}\right )}{2 d^2} \]

[Out]

1/4*a*x^4+b*x^2*arctan(exp(d*x^2+c))/d-1/2*I*b*polylog(2,-I*exp(d*x^2+c))/d^2+1/2*I*b*polylog(2,I*exp(d*x^2+c)
)/d^2

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {14, 5544, 4265, 2317, 2438} \[ \int x^3 \left (a+b \text {sech}\left (c+d x^2\right )\right ) \, dx=\frac {a x^4}{4}+\frac {b x^2 \arctan \left (e^{c+d x^2}\right )}{d}-\frac {i b \operatorname {PolyLog}\left (2,-i e^{d x^2+c}\right )}{2 d^2}+\frac {i b \operatorname {PolyLog}\left (2,i e^{d x^2+c}\right )}{2 d^2} \]

[In]

Int[x^3*(a + b*Sech[c + d*x^2]),x]

[Out]

(a*x^4)/4 + (b*x^2*ArcTan[E^(c + d*x^2)])/d - ((I/2)*b*PolyLog[2, (-I)*E^(c + d*x^2)])/d^2 + ((I/2)*b*PolyLog[
2, I*E^(c + d*x^2)])/d^2

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4265

Int[csc[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c +
 d*x)^m*(ArcTanh[E^((-I)*e + f*fz*x)/E^(I*k*Pi)]/(f*fz*I)), x] + (-Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*
Log[1 - E^((-I)*e + f*fz*x)/E^(I*k*Pi)], x], x] + Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*Log[1 + E^((-I)*e
 + f*fz*x)/E^(I*k*Pi)], x], x]) /; FreeQ[{c, d, e, f, fz}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rule 5544

Int[(x_)^(m_.)*((a_.) + (b_.)*Sech[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simpli
fy[(m + 1)/n] - 1)*(a + b*Sech[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplif
y[(m + 1)/n], 0] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \int \left (a x^3+b x^3 \text {sech}\left (c+d x^2\right )\right ) \, dx \\ & = \frac {a x^4}{4}+b \int x^3 \text {sech}\left (c+d x^2\right ) \, dx \\ & = \frac {a x^4}{4}+\frac {1}{2} b \text {Subst}\left (\int x \text {sech}(c+d x) \, dx,x,x^2\right ) \\ & = \frac {a x^4}{4}+\frac {b x^2 \arctan \left (e^{c+d x^2}\right )}{d}-\frac {(i b) \text {Subst}\left (\int \log \left (1-i e^{c+d x}\right ) \, dx,x,x^2\right )}{2 d}+\frac {(i b) \text {Subst}\left (\int \log \left (1+i e^{c+d x}\right ) \, dx,x,x^2\right )}{2 d} \\ & = \frac {a x^4}{4}+\frac {b x^2 \arctan \left (e^{c+d x^2}\right )}{d}-\frac {(i b) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{c+d x^2}\right )}{2 d^2}+\frac {(i b) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{c+d x^2}\right )}{2 d^2} \\ & = \frac {a x^4}{4}+\frac {b x^2 \arctan \left (e^{c+d x^2}\right )}{d}-\frac {i b \operatorname {PolyLog}\left (2,-i e^{c+d x^2}\right )}{2 d^2}+\frac {i b \operatorname {PolyLog}\left (2,i e^{c+d x^2}\right )}{2 d^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.22 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.19 \[ \int x^3 \left (a+b \text {sech}\left (c+d x^2\right )\right ) \, dx=\frac {a x^4}{4}+\frac {i b \left (d x^2 \left (\log \left (1-i e^{c+d x^2}\right )-\log \left (1+i e^{c+d x^2}\right )\right )-\operatorname {PolyLog}\left (2,-i e^{c+d x^2}\right )+\operatorname {PolyLog}\left (2,i e^{c+d x^2}\right )\right )}{2 d^2} \]

[In]

Integrate[x^3*(a + b*Sech[c + d*x^2]),x]

[Out]

(a*x^4)/4 + ((I/2)*b*(d*x^2*(Log[1 - I*E^(c + d*x^2)] - Log[1 + I*E^(c + d*x^2)]) - PolyLog[2, (-I)*E^(c + d*x
^2)] + PolyLog[2, I*E^(c + d*x^2)]))/d^2

Maple [F]

\[\int x^{3} \left (a +b \,\operatorname {sech}\left (d \,x^{2}+c \right )\right )d x\]

[In]

int(x^3*(a+b*sech(d*x^2+c)),x)

[Out]

int(x^3*(a+b*sech(d*x^2+c)),x)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 184 vs. \(2 (58) = 116\).

Time = 0.26 (sec) , antiderivative size = 184, normalized size of antiderivative = 2.39 \[ \int x^3 \left (a+b \text {sech}\left (c+d x^2\right )\right ) \, dx=\frac {a d^{2} x^{4} - 2 i \, b c \log \left (\cosh \left (d x^{2} + c\right ) + \sinh \left (d x^{2} + c\right ) + i\right ) + 2 i \, b c \log \left (\cosh \left (d x^{2} + c\right ) + \sinh \left (d x^{2} + c\right ) - i\right ) + 2 i \, b {\rm Li}_2\left (i \, \cosh \left (d x^{2} + c\right ) + i \, \sinh \left (d x^{2} + c\right )\right ) - 2 i \, b {\rm Li}_2\left (-i \, \cosh \left (d x^{2} + c\right ) - i \, \sinh \left (d x^{2} + c\right )\right ) - 2 \, {\left (i \, b d x^{2} + i \, b c\right )} \log \left (i \, \cosh \left (d x^{2} + c\right ) + i \, \sinh \left (d x^{2} + c\right ) + 1\right ) - 2 \, {\left (-i \, b d x^{2} - i \, b c\right )} \log \left (-i \, \cosh \left (d x^{2} + c\right ) - i \, \sinh \left (d x^{2} + c\right ) + 1\right )}{4 \, d^{2}} \]

[In]

integrate(x^3*(a+b*sech(d*x^2+c)),x, algorithm="fricas")

[Out]

1/4*(a*d^2*x^4 - 2*I*b*c*log(cosh(d*x^2 + c) + sinh(d*x^2 + c) + I) + 2*I*b*c*log(cosh(d*x^2 + c) + sinh(d*x^2
 + c) - I) + 2*I*b*dilog(I*cosh(d*x^2 + c) + I*sinh(d*x^2 + c)) - 2*I*b*dilog(-I*cosh(d*x^2 + c) - I*sinh(d*x^
2 + c)) - 2*(I*b*d*x^2 + I*b*c)*log(I*cosh(d*x^2 + c) + I*sinh(d*x^2 + c) + 1) - 2*(-I*b*d*x^2 - I*b*c)*log(-I
*cosh(d*x^2 + c) - I*sinh(d*x^2 + c) + 1))/d^2

Sympy [F]

\[ \int x^3 \left (a+b \text {sech}\left (c+d x^2\right )\right ) \, dx=\int x^{3} \left (a + b \operatorname {sech}{\left (c + d x^{2} \right )}\right )\, dx \]

[In]

integrate(x**3*(a+b*sech(d*x**2+c)),x)

[Out]

Integral(x**3*(a + b*sech(c + d*x**2)), x)

Maxima [F]

\[ \int x^3 \left (a+b \text {sech}\left (c+d x^2\right )\right ) \, dx=\int { {\left (b \operatorname {sech}\left (d x^{2} + c\right ) + a\right )} x^{3} \,d x } \]

[In]

integrate(x^3*(a+b*sech(d*x^2+c)),x, algorithm="maxima")

[Out]

1/4*a*x^4 + 2*b*integrate(x^3/(e^(d*x^2 + c) + e^(-d*x^2 - c)), x)

Giac [F]

\[ \int x^3 \left (a+b \text {sech}\left (c+d x^2\right )\right ) \, dx=\int { {\left (b \operatorname {sech}\left (d x^{2} + c\right ) + a\right )} x^{3} \,d x } \]

[In]

integrate(x^3*(a+b*sech(d*x^2+c)),x, algorithm="giac")

[Out]

integrate((b*sech(d*x^2 + c) + a)*x^3, x)

Mupad [F(-1)]

Timed out. \[ \int x^3 \left (a+b \text {sech}\left (c+d x^2\right )\right ) \, dx=\int x^3\,\left (a+\frac {b}{\mathrm {cosh}\left (d\,x^2+c\right )}\right ) \,d x \]

[In]

int(x^3*(a + b/cosh(c + d*x^2)),x)

[Out]

int(x^3*(a + b/cosh(c + d*x^2)), x)